//
//  GRCollectionShopViewCell.m
//  YC_GRice
//
//  Created by Feng Liu on 2018/8/29.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRCollectionShopViewCell.h"

@implementation GRCollectionShopViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setCollectModel:(GRCollectCommonModel *)collectModel {
    [super setCollectModel:collectModel];
    [self configureModel:collectModel];
    _shopName.text      = collectModel.title;
    _shopDescrip.text   = [NSString stringWithFormat:@"%@ | 评分:%.1f | %@",collectModel.categoryName, collectModel.score, collectModel.distance];
}

-(void)setBeenShopModel:(GRCollectCommonModel *)beenShopModel {
    _beenShopModel     = beenShopModel;
    [self configureModel:beenShopModel];
    _shopName.text      = beenShopModel.nickname;
    _shopDescrip.text   = [NSString stringWithFormat:@"%@ | 评分:%.1f",beenShopModel.categoryName, beenShopModel.score];
    _shopDistance.text  = beenShopModel.distance;
    _shopConsumption.hidden = NO;
    _shopConsumption.text    = [NSString stringWithFormat:@"消费过%ld次",beenShopModel.number];
}

- (void)configureModel:(GRCollectCommonModel *)model {
    [_shopIMG sd_setImageWithURL:[NSURL URLWithString:model.mainPhoto]];
    _shopReturn.text    = [NSString stringWithFormat:@"享%.1f折优惠",model.pointGiveRate];
}



- (IBAction)didShowDeleteAction:(id)sender {
    [self showCancle:YES];
}





- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
